/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Business.RecordsOperation;

import Business.Record.Record;
import Business.RecordDBUtil.RecordDBUtil;
import java.util.List;

/**
 *
 * @author hooting
 */
public class RecordsOperation {
	public String[] getReportTitles(){
		List<Record> list = getAllRecords();
		String[] titles = new String[list.size()];
	    for(int i = 0; i < list.size(); i++){
		    titles[i] = list.get(i).title;
		}
		return titles;
    }

	public List<Record> getAllRecords(){
		RecordDBUtil db = new RecordDBUtil();
		List<Record> list = db.retrieveAllRecords();
		return list;
	}

	public void insertRecordToDB(Record r){
		RecordDBUtil db = new RecordDBUtil();
		db.insertRecord(r);
	}
}
